﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DelegateWinForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public delegate void FillTextBox(int x);

        private string textValue = "";

        public void FillMathNote(int note)
        {
            textValue += "Your math note is :" + note + Environment.NewLine;
        }

        public void FillChineseNote(int note)
        {
            textValue += "Your chinese note is :" + note + Environment.NewLine;
        }
        public void ShowTextBox()
        {
            textBox1.Text = textValue;
        }
        
        private void btnShow_Click(object sender, EventArgs e)
        {
            FillTextBox fillTextBox = FillMathNote;
            fillTextBox += FillChineseNote;
            fillTextBox(90);
            ShowTextBox();
        }
    }
}